import 'package:qunaimedical/models/doctor_account.dart';

/// 提交认证用户的数据
class UserPostBean {
  String id, fullname, sex, address, idcard, image, idcardImage;

  DoctorInfo info;

  UserPostBean({
    this.id,
    this.fullname,
    this.sex,
    this.address,
    this.idcard,
    this.image,
    this.idcardImage,
    this.info,
  });

  Map<String, dynamic> toMap() {
    Map<String, dynamic> temp = {'id': id};
    if (fullname != null) {
      temp['fullname'] = fullname;
    }
    if (sex != null && sex.isNotEmpty) {
      temp['sex'] = sex;
    }
    if (address != null && address.isNotEmpty) {
      temp['address'] = address;
    }
    if (idcard != null && idcard.isNotEmpty) {
      temp['idcard'] = idcard;
    }
    if (info != null) {
      temp['doctorInfoList'] = [info.toMap()];
    }
    if (image != null && image.isNotEmpty) {
      temp['image'] = image;
    }
    if (idcardImage != null && idcardImage.isNotEmpty) {
      temp['idcardImage'] = idcardImage;
    }
    return temp;
  }
}
